package cn.yanhu.kuwanapp.home

import androidx.lifecycle.MutableLiveData
import cn.woochen.comlib.BaseViewModel
import cn.yanhu.kuwanapp.bean.response.RespCarouselBean
import cn.yanhu.kuwanapp.bean.response.RespHomeTabBean
import cn.yanhu.kuwanapp.bean.response.RespUserInfoBean
import cn.yanhu.kuwanapp.http.status.ResultState
import cn.yanhu.kuwanapp.utils.ext.request
import cn.yanhu.kuwanapp.utils.ext.rxApi

class MainViewModel:BaseViewModel() {
    val carouselInfo  = MutableLiveData<ResultState<RespCarouselBean>>()
    val homeTabInfo  = MutableLiveData<ResultState<List<RespHomeTabBean>>>()

    //首页奖励轮播
    fun carousel(){
        request({ rxApi.carousel() }, carouselInfo,true)
    }

    //首页tab标签
    fun homeTab(){
        request({ rxApi.homeTab() }, homeTabInfo,true)
    }
}